<template>
    <div class="login-page">

      <van-nav-bar title="子账号登录" left-arrow @click-left="$router.back()" />

      <div class="logo">
        <img src="../../assets/logo.png" >
      </div>

      <van-form @submit="onSubmit">
        <van-field
          required
          v-model="username"
          name="account"
          label="子账号"
          type="tel"
          placeholder="请输入子账号"
          maxlength="11"
          :rules="[
          { required: true, message: '请填写子账号' },
          ]"
        />

        <van-field
          required
          clearable
          v-model="password"
          :type="isShowPwd3 ? 'text' : 'password'"
          name="password"
          label="密码"
          placeholder="请输入密码"
          :rules="[{ required: true, message: '请填写密码' }]"
          :right-icon="isShowPwd3 ? 'eye-o' : 'closed-eye'"
          @click-right-icon="isShowPwd3 = !isShowPwd3"
        />

        <DebounceSubmitBtn
          :isSubmitBtnDisabled="isSubmitBtnDisabled"
          type-name="info"
        />
      </van-form>
      <div class="tips">温馨提示：忘记子账号、密码请联系您的上级领导协助您找回子账号、密码</div>
    </div>
</template>

<script>
import DebounceSubmitBtn from "../../components/DebounceSubmitBtn";
import {mixin_btnStatus} from "../../mixin/mixin_btn";
  export default {
    name: 'login',
    components: {
      DebounceSubmitBtn,
    },
    mixins: [mixin_btnStatus],
    data() {
      return {
        isShowPwd3: false,
        username: '',
        password: '',
      };
    },
    methods: {
      async onSubmit(values) {
        return false
        this._updateSubmitBtnStatus();
        await this.$store.dispatch('getLoginCertificate', values);
        await this.$router.replace(this.$route.query.redirect || '/mine');
        await this.$store.dispatch('getUserAllInfo');
        // await this.signaR.connectServer();
      },
    },
  }
</script>

<style lang="scss" scoped>
  .login-page{
    width: 100%;
    .logo{
      height: 100px;
      width: 100px;
      margin: 30px auto 15px auto;
      img{
        width: 100%;
        border-radius: 50%;
      }
    }
    .register_password{
      margin-top: 40px;
      color: #529DE6;
      font-size: 14px;
      display: flex;
      flex-direction: row;
      justify-content: center;
      .register{
        border-right: 1px solid black;
        padding-right: 10px;
      }
      .password{
        margin-left: 10px;
        border-right: 1px solid black;
        padding-right: 10px;
      }
      .subAccount{
        margin-left: 10px;
      }
    }
    .tips{
      color:red;
      width:95%;
      margin: 0 auto;
    }
  }

</style>
